#include "rtc.h"
#include "rtc_DS1307.h"

int8_t rtc_init()
{
	return DS1307_Init();
}

int8_t rtc_get_datetime(struct datetime_t *dt)
{
	DS1307_GetDateTime(&dt->day, &dt->month, &dt->year, &dt->hour, &dt->min, &dt->sec);
	return 0;
}

int8_t rtc_set_datetime(struct datetime_t *dt)
{
	DS1307_SetDateTime(dt->day, dt->month, dt->year, dt->hour, dt->min, dt->sec);
	return 0;
}
